# $Id$
# Maintainer: Jan de Groot <jgc@archlinux.org>
# Contributor: Tobias Kieslich <tobias@justdreams.de>

pkgname=ghex
pkgver=3.18.3
pkgrel=1
pkgdesc="A simple binary editor for the Gnome desktop"
url="https://wiki.gnome.org/Apps/Ghex"
arch=('i686' 'x86_64')
license=('GPL')
depends=('gtk3')
makedepends=('intltool' 'itstool' 'docbook-xsl' gnome-common git)
options=('!emptydirs')
_commit=6615481532da7d378ef79b0f498ecc43dd0e1d40  # tags/3.18.3^0
source=("git://git.gnome.org/ghex#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname

  ./configure --prefix=/usr --sysconfdir=/etc \
      --localstatedir=/var --disable-static \
      --disable-schemas-compile --enable-compile-warnings=minimum

  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool

  make
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
}
